<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
	<head>
		<base href="<%=basePath%>">
		<title>insert title</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">    
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
			<link rel="stylesheet" type="text/css" href="styles.css">
		-->
		<link rel="stylesheet" type="text/css" href="<%=basePath %>scripts/static/h-ui/css/H-ui.min.css" />
		<link rel="stylesheet" type="text/css" href="<%=basePath %>scripts/static/h-ui.admin/css/H-ui.admin.css" />
		<link rel="stylesheet" type="text/css" href="<%=basePath %>scripts/lib/Hui-iconfont/1.0.7/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="<%=basePath %>scripts/lib/icheck/icheck.css" />
		<link rel="stylesheet" type="text/css" href="<%=basePath %>scripts/static/h-ui.admin/skin/default/skin.css" id="skin" />
		<link rel="stylesheet" type="text/css" href="<%=basePath %>scripts/static/h-ui.admin/css/style.css" />
		<script type="text/javascript" src="<%=basePath %>scripts/jquery-1.9.1.js"></script>
		<script type="text/javascript" src="<%=basePath %>scripts/lib/layer/2.1/layer.js"></script>
		<script type="text/javascript">
			/*关闭layer窗口*/
			function layer_close(){
				window.parent.layer.closeAll();
			}
			/*添加学院信息*/
			function cource_add(){
				var courceNo = $("input[name='courceNo']").val();
				var courceName = $("input[name='courceName']").val();
				var score = $("input[name='courceScore']").val();
				var courceScore = parseFloat(score);
				$.ajax({
					url:'<%=basePath%>cource/addCource',
					type:'post',
					dataType:'text',
					data:{"courceNo":courceNo,"courceName":courceName,"courceScore":courceScore},
					success:function(text){
						if(text=="success"){
							layer.msg("添加成功",{icon:1, time:500});
							setTimeout(function(){
								window.parent.location.reload();
							}, 1000);
						}
					},
					error:function(){
						layer.msg("添加异常");
					}
				});
			}
		</script>
	</head>
	<body>
		<div class="page-container">
			
			<form class="form form-horizontal">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>课程编号：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" name="courceNo">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>课程名称：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" name="courceName">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>课程学分：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" name="courceScore">
					</div>
				</div>
				<div class="row cl">
					<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
						<button onClick="cource_add()" class="btn btn-primary radius" type="button"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
						<button onClick="layer_close()" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
					</div>
				</div>
			</form>
		</div>
	</body>
</html>